<html>
<head><meta charset="utf-8"><title>k#keywords: first draft · edition 2021 · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/index.html">edition 2021</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html">k#keywords: first draft</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="229081470"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/229081470" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scottmcm <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#229081470">(Mar 06 2021 at 09:05)</a>:</h4>
<p>Apparently I was in a writing mood tonight, so here's how far I got:<br>
<a href="https://github.com/scottmcm/rfcs/blob/never-preemptively-reserve-keywords/text/0000-raw-keywords.md">https://github.com/scottmcm/rfcs/blob/never-preemptively-reserve-keywords/text/0000-raw-keywords.md</a></p>



<a name="229082800"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/229082800" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#229082800">(Mar 06 2021 at 09:26)</a>:</h4>
<p><span class="user-mention" data-user-id="125270">@scottmcm</span> I was literally dreaming about this last night (apparently), and in my dream I was debating the feasibility of <code>:foo</code> as the syntax instead. We'd I think have to change the rust parser and not the tokenizer to do it, but it seems plausible, and changing the parser has some advantages (no backwards compatibility)</p>



<a name="229082830"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/229082830" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#229082830">(Mar 06 2021 at 09:27)</a>:</h4>
<p>My main reason was thinking about typing</p>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="n">k</span><span class="err">#</span><span class="k">async</span><span class="w"> </span><span class="k">fn</span> <span class="nf">foo</span><span class="p">()</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</code></pre></div>
<p>for several years, versus</p>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code>:<span class="nc">async</span><span class="w"> </span><span class="k">fn</span> <span class="nf">foo</span><span class="p">()</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</code></pre></div>



<a name="229082838"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/229082838" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#229082838">(Mar 06 2021 at 09:28)</a>:</h4>
<p>That said, whichever way we go, we may be able to keep this backwards compatible by changing parser</p>



<a name="229086790"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/229086790" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scottmcm <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#229086790">(Mar 06 2021 at 10:30)</a>:</h4>
<p>Hmm, true, we could plausibly get away with anything that can't start an expression -- even <code>+async</code>.</p>
<p>Well hopefully the motivation and rationale bits will be useful even if they syntax changes.</p>



<a name="229104340"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/229104340" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Daniel Henry-Mantilla <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#229104340">(Mar 06 2021 at 15:03)</a>:</h4>
<p>I am wondering about a technicality here; consider somebody writing:</p>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="fm">macro_rules!</span><span class="w"> </span><span class="n">m</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="p">(</span><span class="w"> </span><span class="cp">$e</span>:<span class="nc">expr</span><span class="w"> </span><span class="p">)</span><span class="w"> </span><span class="o">=&gt;</span><span class="w"> </span><span class="p">(</span><span class="w"> </span><span class="n">A</span><span class="w"> </span><span class="p">);</span><span class="w"></span>
<span class="w">    </span><span class="p">(</span><span class="w"> </span><span class="cp">$($otherwise</span>:<span class="nc">tt</span><span class="p">)</span><span class="o">*</span><span class="w"> </span><span class="p">)</span><span class="w"> </span><span class="o">=&gt;</span><span class="w"> </span><span class="p">(</span><span class="w"> </span><span class="n">B</span><span class="w"> </span><span class="p">);</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</code></pre></div>
<p>what would the rules for <code>m! { k#pineapple pizza }</code> be? In a world where <code>pineapple</code> is not yet a "future-edition keyword", that macro input cannot possibly be an <code>:expr</code>, so it would probably hit the fallback; and that's a problem! Indeed, the moment such a wonderful keyword were to be added, and with semantics where <code>pineapple &lt;something&gt;</code> would be a valid, syntax-wise, expression, we'd then be changing the semantics of that macro call.</p>
<p>So I just want to raise awareness that there needs to be a special rule for token streams that start with a random not-yet-assigned <code>k#keyword</code>: macro rules need to accept that prefix as any valid high-level group (<code>:ty</code>, <code>:pat</code>, <code>:expr</code>, <code>:item</code>) (and, if the keyword does not exist yet or exists but cannot be used for that ast kind, fail).</p>
<p>In practical terms, the following code ought to always fail to compile (so as long as k#pineapple remains unassigned):</p>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="k">match</span><span class="o">!</span><span class="w"> </span><span class="p">(</span><span class="cp">$,</span><span class="w"> </span><span class="n">expr</span><span class="p">,</span><span class="w"> </span><span class="n">item</span><span class="p">,</span><span class="w"> </span><span class="n">ty</span><span class="p">,</span><span class="w"> </span><span class="n">pat</span><span class="p">)</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="c1">// &lt;- (minor plug for my "anon macro"  suggestion)</span>
<span class="w">    </span><span class="p">(</span><span class="w"></span>
<span class="w">        </span><span class="cp">$dollar</span>:<span class="nc">tt</span><span class="p">,</span><span class="w"> </span><span class="cp">$(</span><span class="w"> </span><span class="cp">$matcher</span>:<span class="nc">ident</span><span class="w"> </span><span class="p">),</span><span class="o">*</span><span class="w"></span>
<span class="w">    </span><span class="p">)</span><span class="w"> </span><span class="o">=&gt;</span><span class="w"> </span><span class="p">(</span><span class="w"></span>
<span class="w">        </span><span class="cp">$(</span><span class="w"></span>
<span class="w">            </span><span class="c1">// Another plug: this shadows macros; would also be a great spot to be using `match!`</span>
<span class="w">            </span><span class="fm">macro_rules!</span><span class="w"> </span><span class="n">ignore</span><span class="w"> </span><span class="p">{(</span><span class="w"> </span><span class="cp">$dollar</span><span class="w"> </span><span class="n">metavar</span><span class="w"> </span>: <span class="cp">$matcher</span><span class="w"> </span><span class="p">)</span><span class="w"> </span><span class="o">=&gt;</span><span class="w"> </span><span class="p">();</span><span class="w"> </span><span class="p">(</span><span class="w"> </span><span class="cp">$($tt</span>:<span class="nc">tt</span><span class="p">)</span><span class="o">*</span><span class="w"> </span><span class="p">)</span><span class="w"> </span><span class="o">=&gt;</span><span class="w"> </span><span class="p">()}</span><span class="w"></span>
<span class="w">            </span><span class="n">ignore</span><span class="o">!</span><span class="p">(</span><span class="w"> </span><span class="n">k</span><span class="err">#</span><span class="n">pineapple</span><span class="w"> </span><span class="n">pizza</span><span class="w"> </span><span class="p">);</span><span class="w"> </span><span class="c1">// ~ ERROR …</span>
<span class="w">        </span><span class="p">)</span><span class="o">*</span><span class="w"></span>
<span class="w">    </span><span class="p">);</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</code></pre></div>



<a name="229110727"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/229110727" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#229110727">(Mar 06 2021 at 16:35)</a>:</h4>
<p>I don't think :keyword works in all places a keyword might need to go. Keywords don't always start expressions.</p>



<a name="229110784"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/229110784" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#229110784">(Mar 06 2021 at 16:36)</a>:</h4>
<p>And I can imagine ambiguity with ascription quite easily.</p>



<a name="229110937"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/229110937" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#229110937">(Mar 06 2021 at 16:38)</a>:</h4>
<p>(I also would still prefer an approach that we can use all the way back to 2015, which not work with k# .)</p>



<a name="229111261"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/229111261" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#229111261">(Mar 06 2021 at 16:42)</a>:</h4>
<p>That said, k# is an evocative syntax, and I do like the idea of using it in 2021 and newer.</p>



<a name="229111413"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/229111413" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#229111413">(Mar 06 2021 at 16:45)</a>:</h4>
<p><code>k#</code> is extra "stand out" in a way that's probably good for any place you're using stuff that's Not Made With Currently Existing Technology.</p>



<a name="229111678"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/229111678" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#229111678">(Mar 06 2021 at 16:48)</a>:</h4>
<p>I don't think this came up in previous discussions: would it make sense to add a 2015/2018 syntax that works like k#, and let that syntax die with 2021 in favor of k# ? That way we get the nice evocative syntax in 2021 and newer, but people get <em>access</em> to every construct in every edition.</p>



<a name="229112291"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/229112291" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#229112291">(Mar 06 2021 at 16:58)</a>:</h4>
<p>why would it need to be different in 2021 compared to 2018?</p>



<a name="229112331"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/229112331" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#229112331">(Mar 06 2021 at 16:59)</a>:</h4>
<p>In 2015/2018 it would change tokenization in macros.</p>



<a name="229112436"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/229112436" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#229112436">(Mar 06 2021 at 17:00)</a>:</h4>
<p>That said, that's <em>extremely</em> unlikely to break existing code (since nothing will be using that otherwise invalid syntax). So another possibility would be to just use k# in all editions after a crater run. That seems like it would make everyone happiest.</p>



<a name="229112465"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/229112465" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#229112465">(Mar 06 2021 at 17:00)</a>:</h4>
<p><span class="user-mention" data-user-id="125270">@scottmcm</span> ^</p>



<a name="229112800"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/229112800" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#229112800">(Mar 06 2021 at 17:05)</a>:</h4>
<p>actually I caught up on all the lang meetings from Jan and Feb in the past week or so and that was mentioned.</p>
<p>It was argued, I think by Niko, that previous editions basically only exist for legacy support of code bases that aren't being updated but still need to be compiled into newer projects.</p>
<p>My extension of that position: If you're developing new code, you should always do so on the newest edition (modulo some reasonable lag time immediately after an edition comes out). From this perspective, old editions not always having every ability is ultimately "mostly fine". It's a slight annoyance, but no edition update yet is an undue burden enough to prevent the transfer. And to use any new ability at all you'd already have to have the newer compiler, so you can't really make an msrv argument either.</p>



<a name="229113266"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/229113266" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#229113266">(Mar 06 2021 at 17:11)</a>:</h4>
<p>I did see that argument, but I don't quite agree with it. I would like people to move to the latest edition. But someone with a large codebase in a previous edition shouldn't have to migrate the whole codebase to a new edition just to use a new keyword in one place.</p>



<a name="229113344"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/229113344" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#229113344">(Mar 06 2021 at 17:12)</a>:</h4>
<p>Also, I wonder if the idea that it could be spelled k#keyword in <em>every</em> edition might be swaying.</p>



<a name="229113785"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/229113785" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#229113785">(Mar 06 2021 at 17:19)</a>:</h4>
<p>Keeping in mind that editions are per-crate, and that large projects often split up the codebase and push rarely touched code into sub-crates to reduce build and rebuild times, and that we have cargo-fix, I don't think it's an undue burden to update the edition.</p>



<a name="229113890"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/229113890" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#229113890">(Mar 06 2021 at 17:20)</a>:</h4>
<p><code>winapi</code> is one of the biggest individual crates I know about, and it could likely be updated to 2018 in under 10 minutes.</p>



<a name="229114025"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/229114025" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#229114025">(Mar 06 2021 at 17:22)</a>:</h4>
<p>It's probably less difficult to update your crate's edition than to update a crate's <code>winit</code> or <code>wgpu</code> dependency.</p>



<a name="229114140"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/229114140" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#229114140">(Mar 06 2021 at 17:24)</a>:</h4>
<p><span class="user-mention silent" data-user-id="224471">Lokathor</span> <a href="#narrow/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft/near/229114025">said</a>:</p>
<blockquote>
<p>It's probably less difficult to update your crate's edition than to update a crate's <code>winit</code> or <code>wgpu</code> dependency.</p>
</blockquote>
<p>or <code>tokio</code> <span aria-label="cry" class="emoji emoji-1f622" role="img" title="cry">:cry:</span></p>



<a name="229114571"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/229114571" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#229114571">(Mar 06 2021 at 17:31)</a>:</h4>
<p>I will admit that there is <strong>one</strong> crate i have seen which is difficult to update from 2015 to 2018: <code>gl_generator</code>. Because the entire system is generating rust code of course, and all the 250+ test cases are jank and generate everything into private inner modules that use <code>include!</code> on files from the <code>OUT_DIR</code> in a way that no one even understands anymore. However, the reason no one understands it is because no one has given the crate and significant attention at all since before 2018 edition was even released. It's also <em>just</em> the test cases that are nonsense, changing the code of the generator to 2018, as well as the generated output to 2018, is fairly easy.</p>



<a name="229116568"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/229116568" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scottmcm <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#229116568">(Mar 06 2021 at 18:02)</a>:</h4>
<p><span class="user-mention silent" data-user-id="239881">Josh Triplett</span> <a href="#narrow/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft/near/229111678">said</a>:</p>
<blockquote>
<p>I don't think this came up in previous discussions: would it make sense to add a 2015/2018 syntax that works like k#, and let that syntax die with 2021 in favor of k# ? That way we get the nice evocative syntax in 2021 and newer, but people get <em>access</em> to every construct in every edition.</p>
</blockquote>
<p>I just don't see why we'd bother expending effort to do so, even if it's a small amount of effort.  I know of no reasons that would keep code on old editions (like MSRVs or frozen toolchains) that would also allow using the new features.</p>
<p>Also, this is one of those problems that goes away over time.  Once the 2027 edition rolls around, any old code still using 2021 will be able to use <code>k#</code> just fine.  It's only 2015 and 2018 that wouldn't, which seems fine.</p>
<p>(And +1 to <span class="user-mention" data-user-id="224471">@Lokathor</span>'s point that the one crate that wants to use <code>k#yeet</code> can move even if all the others stay on an old edition.)</p>



<a name="229116686"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/229116686" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#229116686">(Mar 06 2021 at 18:04)</a>:</h4>
<p>Or have a crate using 2021 export a macro that uses the keyword.</p>



<a name="229116748"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/229116748" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#229116748">(Mar 06 2021 at 18:05)</a>:</h4>
<p>I know it's possible. And maybe it isn't worth the effort. But it feels feasible and I personally feel like it might be worth making universal. I would be happy to do the crater run and review the results.</p>



<a name="229116837"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/229116837" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#229116837">(Mar 06 2021 at 18:06)</a>:</h4>
<p>And if the crater run turns up issues, I'd be happy to just give up on old edition support for this, and sign off on the 2021+-only support.</p>



<a name="229177490"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/229177490" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> isHavvy <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#229177490">(Mar 07 2021 at 10:45)</a>:</h4>
<p><span class="user-mention" data-user-id="125270">@scottmcm</span> Thanks for turning my half-baked idea into a reality.</p>



<a name="229177876"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/229177876" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> isHavvy <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#229177876">(Mar 07 2021 at 10:51)</a>:</h4>
<p>Also, sentence fragment: "Rust could decide to just roll editions more often instead of"</p>



<a name="231652431"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/231652431" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#231652431">(Mar 24 2021 at 15:19)</a>:</h4>
<p>Hey <span class="user-mention" data-user-id="125270">@scottmcm</span> --</p>



<a name="231652499"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/231652499" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#231652499">(Mar 24 2021 at 15:20)</a>:</h4>
<p><span class="user-mention" data-user-id="239881">@Josh Triplett</span> and I were talking about this and we had an idea for a compromise</p>



<a name="231652536"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/231652536" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#231652536">(Mar 24 2021 at 15:20)</a>:</h4>
<p>basically <code>k#foo</code> in Rust 2021+ and <code>rk#foo</code> or whatever on older editions</p>



<a name="231652560"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/231652560" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#231652560">(Mar 24 2021 at 15:20)</a>:</h4>
<p>I've not read the RFC draft :) but I can make time for that</p>



<a name="231652572"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/231652572" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#231652572">(Mar 24 2021 at 15:20)</a>:</h4>
<p>if we want to move this along we need to move quickly</p>



<a name="231652584"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/231652584" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#231652584">(Mar 24 2021 at 15:20)</a>:</h4>
<p>I think it's a good idea and well motivated</p>



<a name="231652612"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/231652612" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#231652612">(Mar 24 2021 at 15:20)</a>:</h4>
<p>not sure how whether the rest of <span class="user-group-mention" data-user-group-id="1977">@T-lang</span> has an opinion</p>



<a name="231658659"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/231658659" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> cuviper <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#231658659">(Mar 24 2021 at 15:54)</a>:</h4>
<p>how is <code>rk#foo</code> any better for older editions?</p>



<a name="231658710"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/231658710" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> cuviper <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#231658710">(Mar 24 2021 at 15:54)</a>:</h4>
<p>I think <code>br#foo</code> is available syntax though</p>



<a name="231658899"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/231658899" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> cuviper <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#231658899">(Mar 24 2021 at 15:55)</a>:</h4>
<p>(as they relate to macro tokenization)</p>



<a name="231659020"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/231659020" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#231659020">(Mar 24 2021 at 15:56)</a>:</h4>
<p>I would still like to see if crater turns up any breakage for just using k#foo on all editions; it's sufficiently unusual syntax that I wouldn't be surprised if it never appears in any existing crate.</p>



<a name="231659110"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/231659110" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#231659110">(Mar 24 2021 at 15:56)</a>:</h4>
<p>But if we can't use that on all editions, then we can use something that is known to not parse on 2015/2018.</p>



<a name="231659582"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/231659582" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#231659582">(Mar 24 2021 at 15:59)</a>:</h4>
<p><span class="user-mention silent" data-user-id="138448">cuviper</span> <a href="#narrow/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft/near/231658710">said</a>:</p>
<blockquote>
<p>I think <code>br#foo</code> is available syntax though</p>
</blockquote>
<p>whatever it is</p>



<a name="231660339"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/231660339" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#231660339">(Mar 24 2021 at 16:03)</a>:</h4>
<p>I just read the RFC draft by <span class="user-mention" data-user-id="125270">@scottmcm</span> and I was pretty happy with it. Of course  we would want to amend it to cover <code>br#</code> or whatever for older editions, to address <span class="user-mention" data-user-id="239881">@Josh Triplett</span>'s concern</p>



<a name="231664428"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/231664428" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#231664428">(Mar 24 2021 at 16:26)</a>:</h4>
<p>(There are several syntaxes we could use in the 2015/2018 editions, and any of them would be fine with me. Not going to bikeshed it.)</p>



<a name="231664514"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/231664514" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#231664514">(Mar 24 2021 at 16:26)</a>:</h4>
<p>(And I really like k# for new code.)</p>



<a name="231678648"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/231678648" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scottmcm <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#231678648">(Mar 24 2021 at 17:47)</a>:</h4>
<p>So, concretely, what would people like me to do with the RFC?  Should I just post it?  Is there another section that someone would like me to add?</p>



<a name="231687322"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/231687322" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#231687322">(Mar 24 2021 at 18:42)</a>:</h4>
<p><span class="user-mention" data-user-id="125270">@scottmcm</span> would you object to me editing it?</p>



<a name="231687356"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/231687356" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#231687356">(Mar 24 2021 at 18:42)</a>:</h4>
<p>oh, I guess it's not in a hackmd</p>



<a name="231687365"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/231687365" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#231687365">(Mar 24 2021 at 18:42)</a>:</h4>
<p>I'll send you a pr</p>



<a name="231687603"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/231687603" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#231687603">(Mar 24 2021 at 18:44)</a>:</h4>
<p>is the syntax for older editions <code>kr#foo</code>, <span class="user-mention" data-user-id="239881">@Josh Triplett</span> / <span class="user-mention" data-user-id="138448">@cuviper</span> ?</p>



<a name="231687615"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/231687615" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#231687615">(Mar 24 2021 at 18:44)</a>:</h4>
<p>surely not <code>br</code></p>



<a name="231687891"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/231687891" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#231687891">(Mar 24 2021 at 18:46)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> It has to be something that doesn't currently tokenize, or whose tokenization won't change as viewed by a macro.</p>



<a name="231687915"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/231687915" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#231687915">(Mar 24 2021 at 18:46)</a>:</h4>
<p>didn't we find something?</p>



<a name="231687930"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/231687930" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#231687930">(Mar 24 2021 at 18:46)</a>:</h4>
<p>you tell me :)</p>



<a name="231687986"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/231687986" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#231687986">(Mar 24 2021 at 18:47)</a>:</h4>
<p><code>r#$keyword</code></p>



<a name="231688105"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/231688105" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#231688105">(Mar 24 2021 at 18:47)</a>:</h4>
<p>I started a discussion in <a href="#narrow/stream/213817-t-lang/topic/Available.20syntax">https://rust-lang.zulipchat.com/#narrow/stream/213817-t-lang/topic/Available.20syntax</a> about available syntax.</p>



<a name="231688452"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/231688452" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#231688452">(Mar 24 2021 at 18:49)</a>:</h4>
<p><code>br#keyword</code> and <code>r#$keyword</code> are both available, and don't seem unreasonable.</p>



<a name="231688622"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/231688622" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#231688622">(Mar 24 2021 at 18:50)</a>:</h4>
<p>I don't think <code>r##keyword</code> is a good idea; too ambiguous with <code>r#keyword</code> which has an opposite meaning.</p>



<a name="231688670"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/231688670" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#231688670">(Mar 24 2021 at 18:51)</a>:</h4>
<p>Something like <code> `keyword </code> is technically an option, but I'd rather not spend one of our limited remaining symbols on this.</p>



<a name="231688846"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/231688846" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#231688846">(Mar 24 2021 at 18:52)</a>:</h4>
<p><a href="https://github.com/scottmcm/rfcs/pull/1">https://github.com/scottmcm/rfcs/pull/1</a></p>



<a name="231688902"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/231688902" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#231688902">(Mar 24 2021 at 18:52)</a>:</h4>
<p>I wrote <code>r#$keyword</code> but i don't care</p>



<a name="231688926"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/231688926" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#231688926">(Mar 24 2021 at 18:52)</a>:</h4>
<p>You appear to have written <code>r#?keyword</code>.</p>



<a name="231688928"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/231688928" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#231688928">(Mar 24 2021 at 18:52)</a>:</h4>
<p>I don't understand <code>br</code>, it doesn't... say 'keyword" to me :)</p>



<a name="231688983"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/231688983" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#231688983">(Mar 24 2021 at 18:52)</a>:</h4>
<p>Ah, the text in your PR uses <code>r#$</code>, just your PR title and description says <code>r#?</code>.</p>



<a name="231688997"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/231688997" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#231688997">(Mar 24 2021 at 18:53)</a>:</h4>
<p>whoops :)</p>



<a name="231689065"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/231689065" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#231689065">(Mar 24 2021 at 18:53)</a>:</h4>
<p>Given that this is for older editions, and newer editions will use <code>k#</code>, I care <em>very little</em> about what color we paint this bikeshed.</p>



<a name="231689106"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/231689106" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#231689106">(Mar 24 2021 at 18:53)</a>:</h4>
<p>I don't have any better suggestions than <code>r#$</code>.</p>



<a name="231689200"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/231689200" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#231689200">(Mar 24 2021 at 18:54)</a>:</h4>
<p>Also, I think your first paragraph got some details mixed up...</p>



<a name="231689272"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/231689272" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#231689272">(Mar 24 2021 at 18:54)</a>:</h4>
<p>You wrote:</p>
<blockquote>
<p>For older editions, the <code>r#$foo</code> syntax cannot be used because macro-rules currently treats them as two distinct tokens. For those editions, we will use <code>kr#</code> for the same purpose.</p>
</blockquote>
<p>I think you wanted <code>k#foo</code> and <code>r#$foo</code>, respectively.</p>



<a name="231689375"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/231689375" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#231689375">(Mar 24 2021 at 18:55)</a>:</h4>
<p>thanks, fixed</p>



<a name="231689399"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/231689399" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#231689399">(Mar 24 2021 at 18:55)</a>:</h4>
<p>I do think the RFC needs to say one more thing about this, beyond the proposed PR:</p>



<a name="231689611"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/231689611" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#231689611">(Mar 24 2021 at 18:56)</a>:</h4>
<p>"We will provide a rustfix migration translating <code>r#$keyword</code> to <code>k#keyword</code> when migrating from Rust 2018 to Rust 2021. Rust 2021 and newer will only accept the <code>k#keyword</code> syntax, not <code>r#$keyword</code>. This allows future editions to repurpose <code>r#$</code> if needed."</p>



<a name="231689633"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/231689633" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#231689633">(Mar 24 2021 at 18:57)</a>:</h4>
<p>Thoughts?</p>



<a name="231689680"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/231689680" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#231689680">(Mar 24 2021 at 18:57)</a>:</h4>
<p>No need to permanently assign that syntax, if it's only for old editions.</p>



<a name="231690152"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/231690152" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#231690152">(Mar 24 2021 at 19:00)</a>:</h4>
<p>Also, given our discovery that we cannot use <code>k#</code> in older editions, to avoid this issue in the future and allow ourselves more flexibility, would it potentially make sense, over the edition boundary, to reserve <em>all</em> syntax productions starting with <code>[a-z]#</code>?</p>



<a name="231692088"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/231692088" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bstrie <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#231692088">(Mar 24 2021 at 19:13)</a>:</h4>
<p>while you're at it, is <code>#</code> the only token worth reserving in this way? specifically, given the existing precedence of <code>b"</code> and <code>r"</code>, I could imagine there being demand for like <code>f"</code> for Python-style f-strings someday</p>



<a name="231692122"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/231692122" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bstrie <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#231692122">(Mar 24 2021 at 19:13)</a>:</h4>
<p>(maybe <code>[a-z]"</code> is already effectively reserved, I'm not sure)</p>



<a name="231704309"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/231704309" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scottmcm <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#231704309">(Mar 24 2021 at 20:36)</a>:</h4>
<p><span class="user-mention silent" data-user-id="239881">Josh Triplett</span> <a href="#narrow/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft/near/231689680">said</a>:</p>
<blockquote>
<p>No need to permanently assign that syntax, if it's only for old editions.</p>
</blockquote>
<p>I definitely don't want to support both ways to write this forever.</p>
<p>(I don't like having <code>r#$foo</code> at all, but I can tolerate it in 2015 if people insist.  I still don't think that the need for it in old editions has been motivated.)</p>



<a name="231705993"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/231705993" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#231705993">(Mar 24 2021 at 20:49)</a>:</h4>
<blockquote>
<p>(I don't like having r#$foo at all, but I can tolerate it in 2015 if people insist. I still don't think that the need for it in old editions has been motivated.)</p>
</blockquote>
<p>could someone explain why you'd want to have <em>both</em> a recent toolchain <em>and</em> be using 2015 edition? you still wouldn't be able to use <code>r#$async</code> before it was added to the compiler</p>



<a name="231711748"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/231711748" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#231711748">(Mar 24 2021 at 21:29)</a>:</h4>
<p><span class="user-mention silent" data-user-id="125270">scottmcm</span> <a href="#narrow/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft/near/231704309">said</a>:</p>
<blockquote>
<p>(I don't like having <code>r#$foo</code> at all, but I can tolerate it in 2015 if people insist.  I still don't think that the need for it in old editions has been motivated.)</p>
</blockquote>
<p>This would be needed for both Rust 2015 and Rust 2018, right? Not just 2015.</p>



<a name="231712121"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/231712121" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scottmcm <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#231712121">(Mar 24 2021 at 21:31)</a>:</h4>
<p>Yes, 2018 too.</p>



<a name="231712164"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/231712164" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#231712164">(Mar 24 2021 at 21:31)</a>:</h4>
<p>The case I'd make is that while we don't <em>in general</em> need to systematically backport new features to old editions, this is specifically a cross-edition-compatibility feature allowing access to keywords from newer editions, and I think there's value in having it available everywhere.</p>



<a name="231712315"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/231712315" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#231712315">(Mar 24 2021 at 21:32)</a>:</h4>
<p><span class="user-mention" data-user-id="232545">@Joshua Nelson</span> The case for having a recent toolchain is that you keep your dependencies up to date. The case for still using the 2015 or 2018 edition is that you have some existing piece of code (for instance, something you're backporting a security patch to).</p>



<a name="231715626"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/231715626" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scottmcm <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#231715626">(Mar 24 2021 at 21:56)</a>:</h4>
<p>What's the status of the edition RFC?  So long as the "people are expected to move to new editions eventually if they're actively working on code" is still there, then I see no reason to support new keywords in pre-2021.  Code that's only getting security fixes and whatnot doesn't need new language features.</p>



<a name="231799624"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/231799624" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#231799624">(Mar 25 2021 at 13:27)</a>:</h4>
<p><span class="user-mention silent" data-user-id="239881">Josh Triplett</span> <a href="#narrow/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft/near/231690152">said</a>:</p>
<blockquote>
<p>Also, given our discovery that we cannot use <code>k#</code> in older editions, to avoid this issue in the future and allow ourselves more flexibility, would it potentially make sense, over the edition boundary, to reserve <em>all</em> syntax productions starting with <code>[a-z]#</code>?</p>
</blockquote>
<p>yes</p>



<a name="231799713"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/231799713" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#231799713">(Mar 25 2021 at 13:28)</a>:</h4>
<p>now that you mention it, I care more about this then about older editions :)</p>



<a name="231799750"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/231799750" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#231799750">(Mar 25 2021 at 13:28)</a>:</h4>
<p><em>in fact</em> we could alter the RFC to be "reserve [a-z]# foo" for future editions</p>



<a name="231799776"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/231799776" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#231799776">(Mar 25 2021 at 13:28)</a>:</h4>
<p>and argue about the details of <code>k#foo</code> later</p>



<a name="231799807"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/231799807" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#231799807">(Mar 25 2021 at 13:28)</a>:</h4>
<p>that said, I sort of agree with <span class="user-mention" data-user-id="125270">@scottmcm</span>'s logic too, I just don't care enough in the end of the day</p>



<a name="231799826"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/231799826" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#231799826">(Mar 25 2021 at 13:28)</a>:</h4>
<p>well, maybe I don't</p>



<a name="231799859"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/231799859" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#231799859">(Mar 25 2021 at 13:29)</a>:</h4>
<p>ok lemme think-- if somebody wants to take advantage of <code>r#$foo</code> --</p>



<a name="231799866"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/231799866" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#231799866">(Mar 25 2021 at 13:29)</a>:</h4>
<p>they have to be using a new compiler --</p>



<a name="231799875"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/231799875" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#231799875">(Mar 25 2021 at 13:29)</a>:</h4>
<p>in which case, why can't they move to a new edition?</p>



<a name="231799929"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/231799929" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#231799929">(Mar 25 2021 at 13:29)</a>:</h4>
<p>I had in mind packages that are maintaining compatibility with older compilers but clearly they can't make use of new keywords or new features</p>



<a name="231799964"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/231799964" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#231799964">(Mar 25 2021 at 13:29)</a>:</h4>
<p>so I guess <span class="user-mention" data-user-id="239881">@Josh Triplett</span> it'd be good if you could give a more precise example of some crate that might benefit</p>



<a name="231800086"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/231800086" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#231800086">(Mar 25 2021 at 13:30)</a>:</h4>
<p>I guess this is exactly what <span class="user-mention" data-user-id="232545">@Joshua Nelson</span> said :)</p>



<a name="231803223"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/231803223" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Daniel Henry-Mantilla <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#231803223">(Mar 25 2021 at 13:50)</a>:</h4>
<p>To me if we stretch a bit the only situation that could come to mind is a big codebase written in an old edition (where by "big" I mean that porting the code to a new edition would be too cumbersome to make, especially if the intent is to publish a security patch update); and some keyword-based feature that enhances or fixes a security issue from the past. Still stretching, we could, for instance, envision a world where the <code>raw_ref_macros</code> would have been only made available on a keyword basis (which, to be honest, I don't think such a thing will ever happen, though, precisely for this very reason).</p>
<p>That being said, such a niche use case could just benefit from the <code>use ::__future__::edition2021;</code> inter-edition-macro hack I showcased somewhere else:</p>
<div class="codehilite" data-code-language="Diff"><pre><span></span><code># Fix UB of intermediate reference
<span class="gd">- let p = &amp;(*ptr).field as *const _;</span>
# two options, either:
<span class="gi">+ let p = &amp; r#$raw (*ptr).field;</span>
# or:
<span class="gi">+ let p = edition2042! { &amp;raw (*ptr).field };</span>
</code></pre></div>



<a name="231835910"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/231835910" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#231835910">(Mar 25 2021 at 16:47)</a>:</h4>
<p>I suppose another scenario:</p>



<a name="231835922"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/231835922" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#231835922">(Mar 25 2021 at 16:47)</a>:</h4>
<p>Maybe there is some feature flag that enables more modern stuff</p>



<a name="231835982"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/231835982" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#231835982">(Mar 25 2021 at 16:48)</a>:</h4>
<p>but the core of the crate retains compatibility back to older editions</p>



<a name="231836027"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/231836027" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#231836027">(Mar 25 2021 at 16:48)</a>:</h4>
<p>this is purely theoretical though, it'd be nice to know if there was even a single crate like this</p>



<a name="231836067"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/231836067" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#231836067">(Mar 25 2021 at 16:48)</a>:</h4>
<p>that said, I don't think it's a ton of extra complexity to support the <code>$</code> form</p>



<a name="231836143"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/231836143" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#231836143">(Mar 25 2021 at 16:49)</a>:</h4>
<p>for my part, I'd check my box either way, I'd just like to see <span class="user-mention" data-user-id="125270">@scottmcm</span> open the RFC :)</p>



<a name="231836265"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/231836265" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#231836265">(Mar 25 2021 at 16:49)</a>:</h4>
<p>bonus points if it reserves <code>[a-zA-Z]+#</code></p>



<a name="231836447"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/231836447" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#231836447">(Mar 25 2021 at 16:50)</a>:</h4>
<p>something else I can imagine happening is some form of keyword that <em>only</em> exists on older editions, because it becomes unnecessary in newer editions</p>



<a name="231836540"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/k%23keywords%3A%20first%20draft/near/231836540" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/k.23keywords.3A.20first.20draft.html#231836540">(Mar 25 2021 at 16:51)</a>:</h4>
<p>example: I could imagine implementing RFC 2229 by having the ability to "opt in" using <code>k#partial || {}</code> or something</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>